import Component from "./component.js";

class LikeButton extends Component {
    constructor(props) {
        super(props);
        this.state = {
            liked: false
        };
    }

    onClick() {
        console.log('执行点击事件')
        this.setState({
            liked: !this.state.liked
        })
    }
    render() {
        return `<button style="background-color:${this.props.color}">${this.state.liked ? '取消' : '点赞'}<span>👍</span> </button>`
    }
}

export default LikeButton;